//
//  CircleScrollView.h
//  TAOVideo
//
//  Created by Lin Eidan on 13-8-12.
//  Copyright (c) 2013年 taomee. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum{
    CircleOrientationPortait,   //上下拨动
    CircleOrientationLandscape  //左右拨动
}CircleOrientation;

@protocol CircleScrollViewDelegate;

@interface CircleScrollView : UIView<UIScrollViewDelegate>

//------------------------------公共 start-----------------------

@property(strong,nonatomic) UIScrollView *myScrollView;
@property(strong,nonatomic) UIPageControl *myPageControl;
@property(strong,nonatomic) IBOutlet UIView *customView;
@property(strong,nonatomic) NSTimer *autoPlayTimer;
@property(assign,nonatomic) BOOL isScrollRunFlag;

@property(assign,nonatomic) int totalPage;
@property(assign,nonatomic) int curPageIndex;
@property(assign,nonatomic) CircleOrientation floatOrientation;
@property(assign,nonatomic) id<CircleScrollViewDelegate>delegate;
@property(strong,nonatomic) NSString *pageXibName;

@property (assign, nonatomic) BOOL isCanAuto;
@property (assign, nonatomic) BOOL isCircle;

-(void)removeTheTimer;  //移除计时，否则有bug
//------------------------------公共 end-----------------------


//------------------------------正常的 start-----------------------
- (id)initWithFrame:(CGRect)frame andPageXibName:(NSString *)pageXibName;   //初始化
-(void)drawContainerWithTotalNums:(int )totalNums andOrientation:(CircleOrientation)orientaion;  //画
//------------------------------正常的 end-----------------------

@end

@protocol CircleScrollViewDelegate <NSObject>

@optional
//刷新页面
-(void)circleScrollView:(UIScrollView *)scrollView refreshThePageWithIndexArray:(NSArray *)indexArray;
-(void)circleScrollViewDidScroll:(UIScrollView *)scrollView;
-(void)circleScrollViewDidEndDecelerating:(CircleScrollView *)circleScrollView didScrollViewToIndex:(int)index;

@end